<template>
	<view class="main-page" style="align-items: center;">
		<view class="single-box">
			<text class="font-666-32">店铺编号</text>
			<text class="font-999-32">{{userData.shopId}}</text>
		</view>
		<view class="divider-1"></view>
		<view class="single-box">
			<text class="font-666-32">店铺账户</text>
			<text class="font-999-32">{{userData.mobile}}</text>
		</view>
		
		<view class="single-box mt-20" style="height: 133rpx;">
			<text class="font-666-32">店铺头像</text>
			<view class="row-container">
				<image class="avatar" :src="userData.headImg" v-if="userData.headImg"></image>
				<image class="avatar" src="../../static/mine/ic_default_avatar.png" v-else></image>
				<image class="wh-20" src="../../static/common/ic_arrow_right.png"></image>
			</view>
		</view>
		
		<view class="single-box mt-20">
			<text class="font-666-32">店铺名称</text>
			<text class="font-333-32 font-weight-600">{{userData.shopName}}</text>
		</view>
		<view class="divider-1"></view>
		<view class="single-box">
			<text class="font-666-32">营业时间</text>
			<view class="row-container">
				<text class="font-333-32 font-weight-600">{{userData.shopStartTime}}</text>
				<image class="wh-20" src="../../static/common/ic_arrow_right.png"></image>
			</view>
		</view>
		<view class="divider-1"></view>
		<view class="single-box">
			<text class="font-666-32">打烊时间</text>
			<view class="row-container">
				<text class="font-333-32 font-weight-600">{{userData.shopEndTime}}</text>
				<image class="wh-20" src="../../static/common/ic_arrow_right.png"></image>
			</view>
		</view>
		<view class="divider-1"></view>
		<view class="single-box">
			<text class="font-666-32">店铺地址</text>
			<text class="font-333-32 font-weight-600 width-70p" style="text-align: right;">{{userData.shopAddress}}</text>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userData:{}
			}
		},
		
		onLoad() {
			this.loadUserDetail()
		},
		
		methods: {
			loadUserDetail(){
				let that = this
				this.http({
					url:"/user/userDetail",
					method:"POST",
					hideLoading:true,
					data:{},
					success(data){
						if (data.code == 200){
							that.userData = data.data
							that.cookie.set("ap_user_data" , data.data)
						}
						uni.stopPullDownRefresh()
					},
					failed(e){
						uni.stopPullDownRefresh()
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.single-box{
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		width: calc(100% - 60rpx);
		height: 105rpx;
		padding: 0rpx 30rpx;
		background: white;
		
		.avatar{
			width: 93rpx;
			height: 93rpx;
			border-radius: 50rpx;
		}
	}
</style>
